//
//  OAUserManagetTests.m
//  OANetworkManager_Tests
//
//  Created by TFAppleWork-Summer on 2018/2/9.
//  Copyright © 2018年 GuoRui. All rights reserved.
//

#import "Tests.h"
#import "AppNetworkingManager+UserMananer.h"
@interface OAUserManagetTests : Tests

@end

@implementation OAUserManagetTests

- (void)setUp {
    [super setUp];
    // Put setup code here. This method is called before the invocation of each test method in the class.
}

- (void)tearDown {
    // Put teardown code here. This method is called after the invocation of each test method in the class.
    [super tearDown];
}
// 测试用户修改
- (void)testUpdateUser{
    
    [self expectation:^(void (^fulfill)(void)) {
        [AppNetworkingManager userUpdateWithAvatarURL:@"http://www.qqzhi.com/uploadpic/2014-11-28/132152687.jpg"
                                                 desc:@""
                                             complete:^(id object, NSError *error) {
                                                 if ([object boolValue]) {
                                                      NSLog(@"用户修改成功");
                                                 }
                                                 else{
                                                     NSLog(@"用户修改失败");
                                                 }
                                                 fulfill();
                                             }];
    }];
    
}
// 测试密码验证
-(void)testVerifyPwd{
    [self expectation:^(void (^fulfill)(void)) {
       [AppNetworkingManager verifyPwdWithPwd:@"111111"
                                     complete:^(id object, NSError *error) {
                                        
                                         if ([object boolValue]) {
                                             NSLog(@"密码验证成功");
                                         }
                                         else{
                                             NSLog(@"密码验证失败");
                                         }
                                         fulfill();
                                     }];
        
    }];
    
    
}
//测试修改密码 | 忘记密码
-(void)testUpdatePwd{
    [self expectation:^(void (^fulfill)(void)) {
       [AppNetworkingManager updatePwdWithPwd:@"111111"
                                        phone:@"18317160680"
                                     complete:^(id object, NSError *error) {
                                         if ([object boolValue]) {
                                             NSLog(@"修改密码成功");
                                         }
                                         else{
                                             NSLog(@"修改密码失败：%@",error.localizedDescription);
                                         }
                                         fulfill();
                                     }];
    }];
    
}


- (void)testPerformanceExample {
    // This is an example of a performance test case.
    [self measureBlock:^{
        // Put the code you want to measure the time of here.
    }];
}

@end
